package org.jash.day2

/**
 * Created by Jash
 */
fun main() {
    val str = "zhangsan 12, lisi 14, wangwu 16"
    val users = str.split(", ")
        .map { it.split(" ") }
        .map { User(it[0], it[1].toInt()) }
        .toMutableList()
    println(users)
//    users.removeIf({ "wang" in it.name })
//    println(users)
    println(users.map { it.age }.average())
    println(users.maxWith(compareBy { it.age }))
}